<?php
/**
 * @version     1.0.0
 * @package     com_general
 * @copyright   Copyright (C) 2012. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 * @author      Quang <quang4it@yahoo.com> - http://quang.com
 */
// no direct access
defined('_JEXEC') or die;

JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');

// Import CSS
$document = JFactory::getDocument();
$document->addStyleSheet('components/com_general/assets/css/general.css');
?>
<script type="text/javascript">
    Joomla.submitbutton = function(task)
    {
        if (task == 'editalbum.cancel' || document.formvalidator.isValid(document.id('editalbum-form'))) {
            Joomla.submitform(task, document.getElementById('editalbum-form'));
        }
        else {
            alert('<?php echo $this->escape(JText::_('JGLOBAL_VALIDATION_FORM_FAILED')); ?>');
        }
    }
</script>

<form action="<?php echo JRoute::_('index.php?option=com_general&layout=edit&id=' . (int) $this->item->id); ?>" method="post" name="adminForm" id="editalbum-form" class="form-validate">
    <div class="row-fluid">
        <div class="span10 form-horizontal">
            <fieldset class="adminform">
                <div class="control-group">
                    <div class="control-label"><?php echo $this->form->getLabel('state'); ?></div>
                    <div class="controls"><?php echo $this->form->getInput('state'); ?></div>
                </div>
                <div class="control-group">
                    <div class="control-label"><?php echo $this->form->getLabel('created_by'); ?></div>
                    <div class="controls"><?php echo $this->form->getInput('created_by'); ?></div>
                </div>
                <div class="control-group">
                    <div class="control-label"><?php echo $this->form->getLabel('title'); ?></div>
                    <div class="controls"><?php echo $this->form->getInput('title'); ?></div>
                </div>
                <div class="control-group">
                    <div class="control-label"><?php echo $this->form->getLabel('categories'); ?></div>
                    <div class="controls"><?php echo $this->form->getInput('categories'); ?></div>
                </div>
                <div class="control-group">
                    <div class="control-label"><?php echo $this->form->getLabel('description'); ?></div>
                    <div class="controls"><?php echo $this->form->getInput('description'); ?></div>
                </div>
                <div class="row-fluid">
                    <div class="span6">
                        <h4><?php echo JText::_('COM_GENERAL_FIELDSET_IMAGES'); ?></h4>
                        <div class="control-group">
                            <?php echo $this->form->getLabel('images'); ?>
                            <div class="controls">
                                <?php echo $this->form->getInput('images'); ?>
                            </div>
                        </div>
                        <?php foreach ($this->form->getGroup('images') as $field): ?>
                            <div class="control-group">
                                <?php if (!$field->hidden): ?>
                                    <?php echo $field->label; ?>
                                <?php endif; ?>
                                <div class="controls">
                                    <?php echo $field->input; ?>
                                </div>
                            </div>
                        <?php endforeach; ?>
                    </div>
                </div>
            </fieldset>
        </div>


        <input type="hidden" name="task" value="" />
        <?php echo JHtml::_('form.token'); ?>

    </div>
</form>